Optimal. Leaf size=290 \[ \frac {8 a^4 (A-i B) \tan ^{m+1}(c+d x) \, _2F_1(1,m+1;m+2;i \tan (c+d x))}{d (m+1)}-\frac {2 \left (A (m+4)^2-i B \left (m^2+8 m+19\right )\right ) \left (a^4+i a^4 \tan (c+d x)\right ) \tan ^{m+1}(c+d x)}{d (m+2) (m+3) (m+4)}-\frac {2 a^4 \left (A \left (2 m^3+19 m^2+60 m+64\right )-i B \left (2 m^3+19 m^2+60 m+67\right )\right ) \tan ^{m+1}(c+d x)}{d (m+1) (m+2) (m+3) (m+4)}-\frac {(A (m+4)-i B (m+7)) \left (a^2+i a^2 \tan (c+d x)\right )^2 \tan ^{m+1}(c+d x)}{d (m+3) (m+4)}+\frac {i a B (a+i a \tan (c+d x))^3 \tan ^{m+1}(c+d x)}{d (m+4)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.07, antiderivative size = 290, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {3594, 3592, 3537, 12, 64} \[ \frac {8 a^4 (A-i B) \tan ^{m+1}(c+d x) \, _2F_1(1,m+1;m+2;i \tan (c+d x))}{d (m+1)}-\frac {2 a^4 \left (A \left (2 m^3+19 m^2+60 m+64\right )-i B \left (2 m^3+19 m^2+60 m+67\right )\right ) \tan ^{m+1}(c+d x)}{d (m+1) (m+2) (m+3) (m+4)}-\frac {2 \left (A (m+4)^2-i B \left (m^2+8 m+19\right )\right ) \left (a^4+i a^4 \tan (c+d x)\right ) \tan ^{m+1}(c+d x)}{d (m+2) (m+3) (m+4)}-\frac {(A (m+4)-i B (m+7)) \left (a^2+i a^2 \tan (c+d x)\right )^2 \tan ^{m+1}(c+d x)}{d (m+3) (m+4)}+\frac {i a B (a+i a \tan (c+d x))^3 \tan ^{m+1}(c+d x)}{d (m+4)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 64
Rule 3537
Rule 3592
Rule 3594
Rubi steps
\begin {align*} \int \tan ^m(c+d x) (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx &=\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}+\frac {\int \tan ^m(c+d x) (a+i a \tan (c+d x))^3 (-a (i B (1+m)-A (4+m))+a (i A (4+m)+B (7+m)) \tan (c+d x)) \, dx}{4+m}\\ &=\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}-\frac {(A (4+m)-i B (7+m)) \tan ^{1+m}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d (3+m) (4+m)}+\frac {\int \tan ^m(c+d x) (a+i a \tan (c+d x))^2 \left (-2 a^2 \left (i B \left (5+6 m+m^2\right )-A \left (8+6 m+m^2\right )\right )+2 a^2 \left (i A (4+m)^2+B \left (19+8 m+m^2\right )\right ) \tan (c+d x)\right ) \, dx}{12+7 m+m^2}\\ &=\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}-\frac {(A (4+m)-i B (7+m)) \tan ^{1+m}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d (3+m) (4+m)}-\frac {2 \left (A (4+m)^2-i B \left (19+8 m+m^2\right )\right ) \tan ^{1+m}(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{d (2+m) \left (12+7 m+m^2\right )}+\frac {\int \tan ^m(c+d x) (a+i a \tan (c+d x)) \left (-2 a^3 \left (i B \left (29+44 m+17 m^2+2 m^3\right )-A \left (32+44 m+17 m^2+2 m^3\right )\right )+2 a^3 \left (i A \left (64+60 m+19 m^2+2 m^3\right )+B \left (67+60 m+19 m^2+2 m^3\right )\right ) \tan (c+d x)\right ) \, dx}{24+26 m+9 m^2+m^3}\\ &=-\frac {2 a^4 \left (A \left (64+60 m+19 m^2+2 m^3\right )-i B \left (67+60 m+19 m^2+2 m^3\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (24+26 m+9 m^2+m^3\right )}+\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}-\frac {(A (4+m)-i B (7+m)) \tan ^{1+m}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d (3+m) (4+m)}-\frac {2 \left (A (4+m)^2-i B \left (19+8 m+m^2\right )\right ) \tan ^{1+m}(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{d (2+m) \left (12+7 m+m^2\right )}+\frac {\int \tan ^m(c+d x) \left (8 a^4 (A-i B) (2+m) (3+m) (4+m)+8 a^4 (i A+B) (2+m) (3+m) (4+m) \tan (c+d x)\right ) \, dx}{24+26 m+9 m^2+m^3}\\ &=-\frac {2 a^4 \left (A \left (64+60 m+19 m^2+2 m^3\right )-i B \left (67+60 m+19 m^2+2 m^3\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (24+26 m+9 m^2+m^3\right )}+\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}-\frac {(A (4+m)-i B (7+m)) \tan ^{1+m}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d (3+m) (4+m)}-\frac {2 \left (A (4+m)^2-i B \left (19+8 m+m^2\right )\right ) \tan ^{1+m}(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{d (2+m) \left (12+7 m+m^2\right )}+\frac {\left (64 i a^8 (A-i B)^2 (2+m) (3+m) (4+m)\right ) \operatorname {Subst}\left (\int \frac {8^{-m} \left (\frac {x}{a^4 (i A+B) (2+m) (3+m) (4+m)}\right )^m}{64 a^8 (i A+B)^2 (2+m)^2 (3+m)^2 (4+m)^2+8 a^4 (A-i B) (2+m) (3+m) (4+m) x} \, dx,x,8 a^4 (i A+B) (2+m) (3+m) (4+m) \tan (c+d x)\right )}{d}\\ &=-\frac {2 a^4 \left (A \left (64+60 m+19 m^2+2 m^3\right )-i B \left (67+60 m+19 m^2+2 m^3\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (24+26 m+9 m^2+m^3\right )}+\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}-\frac {(A (4+m)-i B (7+m)) \tan ^{1+m}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d (3+m) (4+m)}-\frac {2 \left (A (4+m)^2-i B \left (19+8 m+m^2\right )\right ) \tan ^{1+m}(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{d (2+m) \left (12+7 m+m^2\right )}+\frac {\left (i 8^{2-m} a^8 (A-i B)^2 (2+m) (3+m) (4+m)\right ) \operatorname {Subst}\left (\int \frac {\left (\frac {x}{a^4 (i A+B) (2+m) (3+m) (4+m)}\right )^m}{64 a^8 (i A+B)^2 (2+m)^2 (3+m)^2 (4+m)^2+8 a^4 (A-i B) (2+m) (3+m) (4+m) x} \, dx,x,8 a^4 (i A+B) (2+m) (3+m) (4+m) \tan (c+d x)\right )}{d}\\ &=-\frac {2 a^4 \left (A \left (64+60 m+19 m^2+2 m^3\right )-i B \left (67+60 m+19 m^2+2 m^3\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (24+26 m+9 m^2+m^3\right )}+\frac {8 a^4 (A-i B) \, _2F_1(1,1+m;2+m;i \tan (c+d x)) \tan ^{1+m}(c+d x)}{d (1+m)}+\frac {i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^3}{d (4+m)}-\frac {(A (4+m)-i B (7+m)) \tan ^{1+m}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d (3+m) (4+m)}-\frac {2 \left (A (4+m)^2-i B \left (19+8 m+m^2\right )\right ) \tan ^{1+m}(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{d (2+m) \left (12+7 m+m^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 14.23, size = 1805, normalized size = 6.22 \[ \text {result too large to display} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.76, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {16 \, {\left ({\left (A - i \, B\right )} a^{4} e^{\left (10 i \, d x + 10 i \, c\right )} + {\left (A + i \, B\right )} a^{4} e^{\left (8 i \, d x + 8 i \, c\right )}\right )} \left (\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{m}}{e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{4} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.34, size = 0, normalized size = 0.00 \[ \int \left (\tan ^{m}\left (d x +c \right )\right ) \left (a +i a \tan \left (d x +c \right )\right )^{4} \left (A +B \tan \left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{4} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\mathrm {tan}\left (c+d\,x\right )}^m\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^4 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a^{4} \left (\int A \tan ^{m}{\left (c + d x \right )}\, dx + \int \left (- 6 A \tan ^{2}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\right )\, dx + \int A \tan ^{4}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int B \tan {\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int \left (- 6 B \tan ^{3}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\right )\, dx + \int B \tan ^{5}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int 4 i A \tan {\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int \left (- 4 i A \tan ^{3}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\right )\, dx + \int 4 i B \tan ^{2}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int \left (- 4 i B \tan ^{4}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\right )\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________